import Item

class ShoppingCart:
    def __init__(self):
        self.items = []

    def calculatePrice(self, item):
        visitor=Visitor.Cashier()
        for i in self.items:
            i.accept(visitor)
        total=visitor.getTotal()
        return total
        
    def add(self, item):
        self.items.append(item)